export default {
  bind(el, binding) {
    el.setAttribute('style', 'cursor: pointer');
    el.addEventListener('click', ()=>{
      const value = binding.value
      var imgContainer = document.createElement('div');
      imgContainer.innerHTML = `<img src='${value}' style='width: 40%;position: absolute;left:0;right:0;top:0;bottom:0;margin:auto;'/>`
      imgContainer.setAttribute('style', `width: 100vw;height: 100vh;position: fixed;left: 0;text-align: center;top: 0;background: #000;opacity: 0.6;z-index: 9999`)
      document.body.appendChild(imgContainer);
      imgContainer.addEventListener('click', ()=>{
        document.body.removeChild(imgContainer);
      })
    })
  }
}
